package com.ssm.Scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestScope {
    public static void main(String[] args) {
        String xmlPath = "Spring-bean1.xml";
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);
        Scope bean4 = (Scope) applicationContext.getBean("bean4");
        Scope bean5 = (Scope)applicationContext.getBean("bean4");
        System.out.println(bean4);
        System.out.println(bean5);  //无论如何都是一个对象 都是一个Bean4，不会产生第二个Bean4
    }
}
